home *** CD-ROM | disk | FTP | other *** search
- on MoveBuildings
- global theFirstBuildingChannel, theLastBuildingChannel, theBackgroundVelocity, theBuildingCount, theMaxNumBuildings, theFirstDropOffBuilding, theSecondDropOffBuilding, theThirdDropOffBuilding, theFourthDropOffBuilding, theLastDropOffBuilding
- if theBackgroundVelocity < 0 then
- repeat with h = theFirstBuildingChannel to theLastBuildingChannel
- if the right of sprite h < 0 then
- set x1 to the stageRight - the stageLeft
- set x2 to x1 + the width of sprite h
- set y1 to the top of sprite h
- set y2 to the bottom of sprite h
- spriteBox(h, x1, y1, x2, y2)
- set theBuildingCount to 1 + theBuildingCount
- if theBuildingCount > theMaxNumBuildings then
- set theBuildingCount to 1
- end if
- if theBuildingCount = theFirstDropOffBuilding then
- set the memberNum of sprite h to the number of member "Drop Off 1"
- else
- if theBuildingCount = theSecondDropOffBuilding then
- set the memberNum of sprite h to the number of member "Drop Off 2"
- else
- if theBuildingCount = theThirdDropOffBuilding then
- set the memberNum of sprite h to the number of member "Drop Off 3"
- else
- if theBuildingCount = theFourthDropOffBuilding then
- set the memberNum of sprite h to the number of member "Drop Off 4"
- else
- if theBuildingCount = theLastDropOffBuilding then
- set the memberNum of sprite h to the number of member "Drop Off 5"
- else
- set the memberNum of sprite h to getRandomHouse()
- end if
- end if
- end if
- end if
- end if
- else
- set the locH of sprite h to the locH of sprite h + (theBackgroundVelocity / 2)
- end if
- set the stretch of sprite h to 0
- end repeat
- else
- repeat with h = theFirstBuildingChannel to theLastBuildingChannel
- if the left of sprite h > (the stageRight - the stageLeft) then
- set x1 to 0 - the width of sprite h
- set x2 to x1 + the width of sprite h
- set y1 to the top of sprite h
- set y2 to the bottom of sprite h
- spriteBox(h, x1, y1, x2, y2)
- set theBuildingCount to theBuildingCount - 1
- if theBuildingCount < 1 then
- set theBuildingCount to theMaxNumBuildings
- end if
- set temp to theBuildingCount - GetNumScreenBuildings() + 1
- if temp = theFirstDropOffBuilding then
- set the memberNum of sprite h to the number of member "Drop Off 1"
- else
- if temp = theSecondDropOffBuilding then
- set the memberNum of sprite h to the number of member "Drop Off 2"
- else
- if temp = theThirdDropOffBuilding then
- set the memberNum of sprite h to the number of member "Drop Off 3"
- else
- if temp = theFourthDropOffBuilding then
- set the memberNum of sprite h to the number of member "Drop Off 4"
- else
- if temp = theLastDropOffBuilding then
- set the memberNum of sprite h to the number of member "Drop Off 5"
- else
- set the memberNum of sprite h to getRandomHouse()
- end if
- end if
- end if
- end if
- end if
- else
- set the locH of sprite h to the locH of sprite h + (theBackgroundVelocity / 2)
- end if
- set the stretch of sprite h to 0
- end repeat
- end if
- if theBackgroundVelocity < 0 then
- if sprite theFirstBuildingChannel intersects theLastBuildingChannel then
- if the locH of sprite theFirstBuildingChannel < the locH of sprite theLastBuildingChannel then
- set the locH of sprite theLastBuildingChannel to the locH of sprite theLastBuildingChannel + the width of sprite theFirstBuildingChannel
- else
- set the locH of sprite theFirstBuildingChannel to the locH of sprite theFirstBuildingChannel + the width of sprite theLastBuildingChannel
- end if
- end if
- else
- if sprite theFirstBuildingChannel intersects theLastBuildingChannel then
- if the locH of sprite theFirstBuildingChannel > the locH of sprite theLastBuildingChannel then
- set the locH of sprite theFirstBuildingChannel to the locH of sprite theFirstBuildingChannel + the width of sprite theLastBuildingChannel
- else
- set the locH of sprite theLastBuildingChannel to the locH of sprite theLastBuildingChannel + the width of sprite theFirstBuildingChannel
- end if
- end if
- end if
- end
-